package com.example.auth.service;

import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

@Component
public class UserDetailsServiceImpl implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return User.builder()
                .username("admin")
                .password("$2a$10$24CU7C/cX6aTduWHgjYrq.JDSz7Xvy14wrmfL35vwiVbnyniO.WJu")
                .authorities("admin")
//                .accountLocked()  // 设置当前账号是都锁定,false表示不锁定
//                .disabled() // 设置当前账号是否可用 false 表示可用
                .build();

    }
}
